﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace N03_11HCA_HTTTHD.Models
{
    public class TimMua_ChiTiet
    {
        public TimMua_ChiTiet(Data_DAO_DTO_Lib.DTO.THONGTINTIMMUA_DTO tm, List<Data_DAO_DTO_Lib.DTO.DTO> listDanhMucMuaSanPham)
        {
            this.ttTimMua = tm;
            setListDanhMucCanMuaDTO(listDanhMucMuaSanPham);
        }

        //lay danh sach danh muc
        private List<Data_DAO_DTO_Lib.DTO.DANHMUC_DTO> listDanhMucSanPham;

        public List<Data_DAO_DTO_Lib.DTO.DANHMUC_DTO> ListDanhMucSanPham
        {
            get
            {
                return listDanhMucSanPham;
            }
            set
            {
                listDanhMucSanPham = value;
            }
        }
        //set list danh muc can mua
        void setListDanhMucCanMuaDTO(List<Data_DAO_DTO_Lib.DTO.DTO> l)
        {
            listDanhMucSanPham = new List<Data_DAO_DTO_Lib.DTO.DANHMUC_DTO>();

            for (int i = 0; i < l.Count; i++)
            {
                listDanhMucSanPham.Add((Data_DAO_DTO_Lib.DTO.DANHMUC_DTO)l[i]);
            }
        }

        private Data_DAO_DTO_Lib.DTO.THONGTINTIMMUA_DTO timMua;
        public Data_DAO_DTO_Lib.DTO.THONGTINTIMMUA_DTO ttTimMua
        {
            get
            {
                return timMua;
            }
            set
            {
                timMua = value;
            }
        }
    }
}